/*
 * @Description:
 * @Version: 2.0
 * @Autor: kafei
 * @Date: 2021-12-21 17:37:53
 * @LastEditors: kafei
 */
import { initGlobalState } from 'qiankun'
import store from '../store/index'
// 定义全局下发的数据
import { initialState } from './globalState.js'
const qiankunActions = initGlobalState(initialState)

qiankunActions.onGlobalStateChange((state) => {
//   console.log(state, 'asdasdsa')
  for (const key in state) {
    if (key === 'userInfo') {
      const item = state[key]
      store.commit('info/UPDATE_DATA', item)
    }
  }
})
